Skip to content

feat: added input validation in installer#26

Open
Ayush4958 wants to merge 2 commits into
TheCodeVerseHub:mainfrom
Ayush4958:input-validation-installer
Open

feat: added input validation in installer#26
Ayush4958 wants to merge 2 commits into
TheCodeVerseHub:mainfrom
Ayush4958:input-validation-installer

Conversation

@Ayush4958
Copy link
Copy Markdown
Contributor

Summary

I had added input validation and safety checks in installation process which will prevent user to enter invalid input during installlation.

Changes

  • Validate Disk Selection
  • Prevent an accidental formatting , check if the disk is mounted or not , checks for disk labels (archiso/cvh/codeverse)
  • Safer Hostname & Username Input , re-try had been limited upto 3 attempt at single run

Related Issue

Fix #16

Checklist

  • Scope is focused (no unrelated changes)
  • Docs updated (if needed)
  • Scripts/configs changed were tested

Signed-off-by: Ayush <bhandariayush935@gmail.com>
Copy link
Copy Markdown
Contributor

@youngcoder45 youngcoder45 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbh looks good to me just want a review from @sinisterMage

Comment thread scripts/install.sh
log_warn "Invalid username '$USERNAME'. (Attempt $attempt/$max_attempts)"
echo -e " ${DIM}Usernames must start with a letter or underscore,${NC}"
echo -e " ${DIM}and contain only lowercase letters, digits, - or _.${NC}"
echo
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wow

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds additional input validation and safety checks to the interactive installer flow to reduce the risk of destructive actions (e.g., wiping the wrong disk) due to invalid user input.

Changes:

  • Adds live-boot medium detection and excludes it from install targets (including --disk preselection).
  • Improves disk selection UX with detailed disk info and a confirmation prompt; adds retry limits for invalid selections.
  • Adds retry-limited validation loops for hostname and username prompts.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/install.sh Outdated
Comment thread scripts/install.sh
Comment thread scripts/install.sh
Comment thread scripts/install.sh Outdated
Comment thread scripts/install.sh
Comment thread scripts/install.sh
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add input validation to installer

3 participants